;
(function ($) {
    "use strict";

    $('.showMore').on('click', function () {

        var txt = $(this).text();
        var showFlag;
        if (txt == '+更多') {
            showFlag = 1;
        } else {
            showFlag = 0;
        }
        if (showFlag == 1) {
            $('#brand').scrollTop(0);
            $(this).text('-收起').siblings('.dd').css({'max-height': '205px', 'overflow': 'auto', 'height': 'auto'});


            showFlag == 0;
        } else {

            $(this).text('+更多').siblings('.dd').css({'height': '41px', 'overflow': 'hidden'});
            showFlag == 1;
        }
    })
   /* var listRender = {
        init: function (dataUrl) {
            var $listBox = $("#listItem ul");
            $.ajax({
                url: dataUrl,
                dataType: 'json',
                scriptCharset: 'utf-8',
                success: function (data) {
                    console.log(data.status)

                    var str = '',
                        status,
                        channelType,
                        shortMdseName,
                        mdseCode,
                        skuCode,
                        cashPrice = data.cashPrice, //现金价
                        marketPrice = data.marketPrice,  //市场价
                        pointPrice,
                        primaryImg,
                        productSource,
                        promotionFlag,
                        linkUrl;
                    status = data.status;
                    if (status === '01') {
                        $.each(data.result.r, function (i, item) {
                            channelType = item.channelType; //渠道
                            skuCode = item.skuCode; //渠道
                            shortMdseName = item.shortMdseName; //短名
                            cashPrice = item.cashPrice; //现金价
                            marketPrice = item.marketPrice;  //市场价
                            pointPrice = item.pointPrice; //积分价
                            primaryImg = item.primaryImg; //图片
                            productSource = item.productSource; //商品来源
                            promotionFlag = item.promotionFlag; // 是否促销
                            linkUrl = 'http://mall.sit.com/mdseDetail_v2/'+ channelType +'_'+ skuCode +'.htm';
                            str += '<li><a class="item_img" href='+ linkUrl +'><img src="' + primaryImg + '">';
                            if (productSource == 4) {
                                str += '  <i class="source source_jd"></i>';
                            }
                            str += '    </a>';
                            str += '    <div class="title"><a href='+ linkUrl +'>'+ shortMdseName +'</a></div>';
                            str += '    <div class="price"><ins>' + cashPrice + '</ins><i>元</i>';
                            str += '    &nbsp;+&nbsp;<ins>' + pointPrice + '</ins><i>积分</i>';
                            if(promotionFlag){
                            str += '    <span class="preferential">优惠</span></div>';
                            }
                            str += '    <del class="market_price">市场价：' + marketPrice + '元</del><span class="comments">23</span>';
                            str += '</li>';
                        })
                        $listBox.html(null);
                        $(str).appendTo($listBox);
                    }
                }
            })
        },
        listpage :function(pageIndex){
                var page=$.fed.page("#page_id",{
                    totalAmount: 100,
                    currentPage: pageIndex,
                    totalAmountShow: true,
                    onePagehide: false,
                    callback:function(index){
                        listRender.init("http://localhost:8090/resources/data/queryMdseListPage2.htm?"+index);
                    }
                });
        }
    }
    listRender.init("http://localhost:8090/resources/data/queryMdseListPage2.htm");
    listRender.listpage()*/
})(jQuery);